import type { RouteConfig } from '../../typings/router';
import roleController from '../controllers/role';

/**
 * 角色模块路由
 */
const roleRoutes: RouteConfig[] = [
    {
        method: 'get',
        name: 'roleRetrieve',
        path: '/role/retrieve',
        middlewares: [roleController.retrieveAction],
    },
    {
        method: 'post',
        name: 'roleAdd',
        path: '/role/add',
        middlewares: [roleController.addAction],
    },
    {
        method: 'put',
        name: 'roleUpdate',
        path: '/role/update',
        middlewares: [roleController.updateAction],
    },
    {
        method: 'delete',
        name: 'roleDelete',
        path: '/role/delete',
        middlewares: [roleController.deleteAction],
    },
    {
        method: 'post',
        name: 'roleAuthorization',
        path: '/role/authorization',
        middlewares: [roleController.authorizationAction],
    },
    {
        method: 'get',
        name: 'roleAll',
        path: '/role/all',
        middlewares: [roleController.allAction],
    },
    {
        method: 'get',
        name: 'roleToMenuIds',
        path: '/role/roleToMenuIds',
        middlewares: [roleController.roleToMenuIdsAction],
    },
];

export default roleRoutes;
